<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Chapter 1</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=app03.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=app03lev1sec2.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"><a name="app03lev1sec1"></a>
<h3 class="docSection1Title">Chapter 1</h3>
<p class="docText"></P>
<P><table border="0" cellspacing="16" cellpadding="0"><tr valign="top"><TD align="right" class="docText" width="50"><a name="ch01qa1q1a1"></a><B><a class="docLink" href="ch01lev1sec20.html#ch01qa1q1">1.1</a></b></TD><td><p class="docText">For this exercise, we use the following two arguments for the <tt>ls</tt>(1) command: <tt>-i</tt> prints the i-node number of the file or directory (we say more about i-nodes in <a class="docLink" href="ch04lev1sec14.html#ch04lev1sec14">Section 4.14</a>), and <tt>-d</tt> prints information about a directory instead of information on all the files in the directory.</P>
<p class="docText">Execute the following:</P>
<pre>
   $ <span class="docEmphStrong">ls -ldi /etc/. /etc/..</span>            -i <span class="docEmphItalicAlt">says print i-node number</span>
    162561 drwxr-xr-x  66 root     4096 Feb  5 03:59 /etc/./
         2 drwxr-xr-x  19 root     4096 Jan 15 07:25 /etc/../
   $ <span class="docEmphStrong">ls -ldi /. /..</span>                    <span class="docEmphItalicAlt">both . and .. have i-node number 2</span>
         2 drwxr-xr-x  19 root     4096 Jan 15 07:25 /./
         2 drwxr-xr-x  19 root     4096 Jan 15 07:25 /../
</pre><BR>

</td></TR><tr valign="top"><TD align="right" class="docText" width="50"><a name="ch01qa1q2a2"></a><B><a class="docLink" href="ch01lev1sec20.html#ch01qa1q2">1.2</a></b></TD><td><p class="docText">The UNIX System is a multiprogramming, or multitasking, system. Other processes were running at the time this program was run.</P></TD></tr><TR valign="top"><TD align="right" class="docText" width="50"><a name="ch01qa1q3a3"></a><b><a class="docLink" href="ch01lev1sec20.html#ch01qa1q3">1.3</a></b></td><td><p class="docText">Since the <span class="docEmphasis">ptr</span> argument to <tt>perror</tt> is a pointer, <tt>perror</tt> could modify the string that <span class="docEmphasis">ptr</span> points to. The qualifier <tt>const</tt>, however, says that <tt>perror</tt> does not modify what the pointer points to. On the other hand, the error number argument to <tt>strerror</tt> is an integer, and since C passes all arguments by value, the <tt>strerror</tt> function couldn't modify this value even if it wanted to. (If the handling of function arguments in C is not clear, you should review <a class="docLink" href="ch05lev1sec2.html#ch05lev1sec2">Section 5.2</a> of Kernighan and Ritchie [<a class="docLink" href="bib01.html#biblio01_029">1988</a>].)</p></TD></tr><TR valign="top"><td align="right" class="docText" width="50"><a name="ch01qa1q4a4"></a><B><a class="docLink" href="ch01lev1sec20.html#ch01qa1q4">1.4</a></b></td><td><p class="docText">It is possible for the calls to <tt>fflush</tt>, <tt>fprintf</tt>, and <tt>vprintf</tt> to modify <tt>errno</tt>. If they did modify its value and we didn't save it, the error message finally printed would be incorrect.</p></td></tr><tr valign="top"><td align="right" class="docText" width="50"><a name="ch01qa1q5a5"></a><b><a class="docLink" href="ch01lev1sec20.html#ch01qa1q5">1.5</a></b></td><td><p class="docText">During the year 2038. We can solve the problem by making the <tt>time_t</tt> data type a 64-bit integer. If it is currently a 32-bit integer, applications will have to be recompiled to work properly. But the problem is worse. Some file systems and backup media store times in 32-bit integers. These would need to be updated as well, but we still need to be able to read the old format.</p></td></tr><tr valign="top"><td align="right" class="docText" width="50"><a name="ch01qa1q6a6"></a><b><a class="docLink" href="ch01lev1sec20.html#ch01qa1q6">1.6</a></b></td><TD><p class="docText">Approximately 248 days.</P></td></TR></table></P>

<UL></ul></TD></TR></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=app03.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=app03lev1sec2.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html><br>
<table width="100%" cellspacing="0" cellpadding="0"
style="margin-top: 0pt; border-collapse: collapse;"> 
<tr> <td align="right" style="background-color=white; border-top: 1px solid gray;"> 
<a href="http://www.zipghost.com/" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">The CHM file was converted to HTM by Trial version of <b>ChmD<!--227-->ecompiler</b>.</a>
</TD>
</TR><tr>
<td align="right" style="background-color=white; "> 
<a href="http://www.etextwizard.com/download/cd/cdsetup.exe" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">Download <b>ChmDec<!--227-->ompiler</b> at: http://www.zipghost.com</a>
</TD></tr></table>
